﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Fee.Mapping
{
    public class ConstructionTaskCostDetailMapping : IEntityTypeConfiguration<ConstructionTaskCostDetail>
    {
        public void Configure(EntityTypeBuilder<ConstructionTaskCostDetail> map)
        {
            map.HasKey(_ => _.Id);
            map.Property(_ => _.Id).ValueGeneratedOnAdd();

            map.Property(_ => _.ConstructionCoordination);
            map.Property(_ => _.ConstructionOccupancy);
            map.Property(_ => _.ConstructionsSetupAmount);
            map.Property(_ => _.Design);

            map.Property(_ => _.Equipment);
            map.Property(_ => _.FirstPartyMeterial);
            map.Property(_ => _.MaterialFee);

            map.Property(_ => _.MiddleStationJumperDesign);
            map.Property(_ => _.PreConverageDataInput);
            map.Property(_ => _.RuleCost);
            map.Property(_ => _.SafeProduce);
            map.Property(_ => _.SecondaryMaterial);
            map.Property(_ => _.TransferDataInput);
            map.Property(_ => _.VendorMaterialFee);

            map.Property(_ => _.SporadicMaterialAndInputInfo);
            map.Property(_ => _.Supervisor);
            map.Property(_ => _.Type);
            map.OwnsOne(_ => _.ProcessInfo, opro =>
            {
                opro.Property(f => f.Number).HasMaxLength(36);
                opro.Property(f => f.ConstructionOperator);
            });
        
            map.ToTable("fee_ConstCostDetail");
        }
    }
}